<template>
  <el-dialog title="积分记录" :close-on-click-modal="false" :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width=" 900px">
    <custom-table v-loading="listLoading" :data="list">
      <el-table-column prop="points" label="积分值" header-align="center" align="right" width="60" />
      <el-table-column prop="total" label="总积分" align="right" width="60" />
      <el-table-column prop="type" label="操作类型" align="center" width="80">
        <template slot-scope="scope">
          {{ scope.row.type | dynamicText(typeOptions) }}
        </template>
      </el-table-column>
      <el-table-column prop="ruleTitle" label="规则标题" align="center" width="100" />
      <el-table-column prop="memo" label="备注" align="center" />
      <el-table-column prop="createTime" label="创建时间" align="center" :formatter="custom.tableDateTimeFormat" width="120" />
      <el-table-column prop="createUserName" label="创建用户" align="center" width="100" />
    </custom-table>
  </el-dialog>
</template>
<script>
import request from '@/utils/request'
export default {
  components: {},
  data() {
    return {
      query: {},
      list: [],
      listLoading: true,
      visible: false,
      typeOptions: [{ fullName: '人工操作', id: 'Artificial' }, { fullName: '系统操作', id: 'System' }]
    }
  },
  computed: {},
  created() {},
  methods: {
    init(id) {
      this.visible = true
      this.$nextTick(() => {
        request({
          url: `/api/campus/integral/log/list/${id}`,
          method: 'GET'
        }).then(res => {
          this.list = res.data
          this.listLoading = false
        })
      })
    }
  }
}
</script>
